define(["../logic/detailpage", "../common/common"],
    function (pluginClass, c) {
        return {
            pluginClass: pluginClass,
            style: {
                backgroundColor: '#fff'

            },
            nocache: true,
            root: ["mainvlayout"],
            components: {
                mainvlayout: {
                    type: "vbox",
                    style: {
                        height: "100%",
                        width: "100%"
                    },
                    items: [{
                        root: ["main_header"],
                        style: {
                            height: "40px",
                            backgroundColor: "#F5F5F5"
                        }
                    },
                        {
                            root: ["main_body"],
                            className: 'abc',
                            style: {
                                overflow: 'auto'
                            }
                        }]
                },
                main_header: {
                    type: "view",
                    className:"noPrint",
                    root: ["header_title", "header_edit", "header_close"]
                },
                header_title: {
                    type: "text",
                    text_bind: "templateName",
                    style: {
                        fontSize: 14,
                        width: "62%",
                        color: "#666666",
                        height: "40px",
                        lineHeight: "40px",
                        paddingLeft: "20px",
                        overflow: "hidden",
                        textOverflow: "ellipsis",
                        whiteSpace: "nowrap",
                        display: "inline-block"
                    }
                },
                header_edit: {
                    type: "view",
                    style: {
                        float: "right",
                        right: "60px",
                        height: "40px",
                        lineHeight: "35px"
                    },
                    root: ["edit_btn", "more_edit","more_popup"]
                },
                more_edit:{
                    type:"icon",
                    style:{
                        display: "inline-block",
                        fontSize:16,
                        paddingLeft:"20px",
                        color:"#AAAAAA",
                        cursor:"pointer"
                    },
                    font: "icomoon_e92f",
                },
                more_popup:{
                    type:"view",
                    className:"more_popup displaynone",
                    style:{
                        position:"absolute",
                        width:90,
                        backgroundColor:"white",
                        padding:"10px 0",
                        zIndex:999,
                        right:-38,
                        borderRadius:"2px",
                        textAlign:"center",
                        boxShadow: "1px 2px 3px #aaa"
                    },
                    root:["delete_btn","print_btn"]
                },
                print_btn: {
                    type: "text",
                    style: {
                        fontSize: 13,
                        color: "#666666",
                        cursor: "pointer"
                    },
                    text: "打印",
                },
                edit_btn: {
                    type: "text",
                    className: "header-edit-btn",
                    style: {
                        fontSize: 13,
                        color: "#666666",
                        cursor: "pointer",
                        paddingRight: 10,
                        display:"inline-block"
                    },
                    text: "编辑",
                },
                delete_btn: {
                    type: "text",
                    style: {
                        fontSize: 14,
                        color: "#666666",
                        cursor: "pointer",
                    },
                    text: "删除",
                },
                header_close: {
                    type: "icon",
                    font: "icomoon_e90a",
                    style: {
                        float: "right",
                        position: "absolute",
                        right: "9px",
                        top: 0,
                        cursor: "pointer",
                        color: "#cccccc"
                    },
                },
                main_body: {
                    type: "view",
                    className: 'main-box',
                    root: ["row_view", "rowview_bottom_line","segement", "segment_status"]
                },
                rowview_bottom_line: {
                    type: 'view',
                    style: {
                        width: "100%",
                        height: 1,
                        marginLeft:20,
                        backgroundColor: '#eee',
                        marginBottom:10

                    }
                },
                row_view: {
                    className:'canPrint',
                    style: {
                        backgroundColor: '#fff',
                        overflow: "hidden",
                        padding: 20,
                        paddingBottom:0,
                    },
                    type: 'view',
                    root: ['avatar', 'right_view']
                },
                avatar: {
                    type: 'image',
                    style: {
                        position: 'absolute',
                        width: 45,
                        height: 45,
                        lineHeight:"45px",
                        textAlign:"center",
                        borderRadius: '100%'
                    },
                    src_bind: 'avatar'
                },
                right_view: {
                    style: {
                        // paddingLeft: 60,
                    },
                    type: 'view',
                    root: ['user_title', 'like_btn', 'collect_btn', 'when_where_wrap', 'label_texts', 'form_content', 'atPersons', 'images', 'files', 'position']
                },
                user_title:{
                    type: 'view',
                    style: {
                        position: "absolute",
                        marginLeft: 60,
                        fontSize: 14,
                        color: '#666',
                        display: 'inline-block'
                    },
                    root:['user_name', 'range_icon']
                },

                user_name: {
                    ref: true,
                    style: {
                        fontSize: 14,
                        color: '#666',
                        display: 'inline-block'
                    },
                    type: 'text',
                    text_bind: 'userName'
                },
                when_where_wrap: {
                    type: 'view',
                    style: {
                        position: "absolute",
                        right: 0,
                        top: 20,
                    },
                    root: ['when', 'where']
                },
                range_icon: {
                    type: "icon",
                    font: "icomoon_e924",
                    style: {
                        display: "inline-block",
                        verticalAlign: "top",
                        fontSize: 20,
                        cursor: "pointer",
                        lineHeight: "16px",
                        color: "#D2D6D6"
                    }
                },
                like_btn: {
                    type: "icon",
                    font: "icomoon_e926",
                    selectedClassName: "like-selected",
                    style: {
                        cursor: "pointer",
                        position: "absolute",
                        top: -5,
                        right: 30,
                        color: "#b3b3b3",
                        lineHeight: "20px",
                        width: 20
                    }

                },
				collect_btn: {
					type: "icon",
                    font: "icomoon_e936",
                    selectedClassName: "collect-selected",
                    style: {
                        cursor: "pointer",
                        position: "absolute",
                        top: -5,
                        right: 0,
                        color: "#b3b3b3",
                        lineHeight: "20px",
                        width: 20
                    }
				},
                when: {
                    style: {
                        marginLeft: 60,
                        display: 'inline-block',
                        fontSize: 12,
                        color: '#999'
                    },
                    type: 'text',
                    text: ''
                },
                where: {
                    style: {
                        display: 'inline-block',
                        fontSize: 12,
                        marginLeft: 10,
                        color: '#999'
                    },
                    type: 'text',
                    text: ''
                },
                label_texts: {
                    type: "repeat",
                    ref: true,
                    direction: "row",
                    items: [],
                    style: {
                        position: "relative",
                        top: 18,
                        left: 60,
                    },
                    itemStyle: {
                        textAlign: "center"
                    },

                    root: ["label_text"]
                },
                atPersons:{
                    type:"text",
                    text_bind: 'atStr',
                    preText:"@",
                    style: {
                        marginBottom: 10,
                        fontSize: 14,
                        color: "#29B6F6",
                    }
                },
                form_content: {
                    type: 'repeat',
                    ref: true,
                    items_bind: 'content',
                    itemStyle: {
                        marginBottom: '5px'
                    },
                    style: {
                        marginBottom: 10,
                        marginTop: 30,
                        width: '100%',
                    },
                    root: ['form_item_label', 'form_content_item_text']
                },
                images: {
                    type: 'repeat',
                    ref: true,
                    items_bind: "fileStr",
                    itemStyle: {
                        textAlign: "center",
                        display: 'inline-block'
                    },
                    style: {
                        width: 356
                    },
                    root: ['image_repeat']

                },
                position: {
                    type: 'icon',
                    text_bind: 'location',
                    font: 'icomoon_e91f',
                    style: {
                        fontSize: 12,
                        color: "#999999",
                    }
                },

                label_text: {
                    type: 'text',
                    text_bind: 'label',
                    style: {
                        borderRadius: 4,
                        padding: '0 4px',
                        fontSize: 12,
                        color: '#fff',
                        backgroundColor: '#1FDA9A',
                        marginRight: 5
                    }
                },

                files: {
                    type: 'repeat',
                    ref: true,
                    items_bind: "files",
                    style: {
                        width: '100%'
                    },
                    root: ['file_repeat']
                },
                file_repeat: {
                    type: 'view',
                    style: {
                        paddingLeft: 10,
                        lineHeight: '30px',
                        width: '100%',
                        backgroundColor: '#F7F7F7'
                    },
                    root: ['file_type_icon', 'file_name', 'file_download']

                },
                file_download: {
                    style: {
                        color: '#666666',
                        fontSize: 13,
                        float: 'right',
                        lineHeight: '34px',
                        marginRight: 10
                    },
                    type: 'icon',
                    font: 'icomoon_e91e',
                    text: '下载'
                },
                file_type_icon: {
                    type: 'image',
                    src_bind: 'iconPath',
                    style: {
                        width: '14px',
                        display: 'inline-block',
                        height: '11px'
                    }
                },
                file_name: {
                    style: {
                        marginLeft: 10,
                        color: '#666666',
                        fontSize: 13,
                        display: 'inline-block',
                    },
                    type: 'text',
                    text_bind: "fileName",
                },


                form_item_label: {
                    type: 'text',
                    text_bind: 'title',
                    style: {
                        fontSize: '14px',
                        lineHeight: '14px'
                    }
                },
                form_content_item_text: {
                    type: 'text',
                    text_bind: 'content',
                    style: {
                        fontSize: 14
                    }
                },

                image_repeat: {
                    style: {
                        height: 103,
                        width: 102,
                        marginRight: 10,
                    },
                    type: 'image',
                    src_bind: 'fileKey'
                },

                segment_status: {
                    ref: true,
                    type: "statusview",
                    defaultKey: "reply_wrap",
                    style:{
                        padding:'0 10px'
                    }
                },
                reply_wrap: {
                    type: "view",
                    style: {
                        minHeight: 100,
                        padding: '0 10px'
                        // backgroundColor: "red"
                    },
                    root: ['attach_info_comment']
                },
                attach_info_comment: {
                    type: 'view',
                    ref: true,
                    root: ['comment_write', 'comment_list']
                },
                comment_write: {
                    type: 'view',
                    style: {
                        border: '1px solid #eee'
                    },
                    root: ['comment_textarea', 'comment_textnumber', 'comment_btn']
                },
                comment_textarea: {
                    type: 'textarea',
                    ref: true,
                    maxlength: 200,
                    style: {
                        border: 'none',
                        height: 80,
                        borderRadius: 0,
                        padding: 10,
                        color: '#333',
                        fontSize: '13px'
                    }
                },
                comment_textnumber: {
                    type: 'text',
                    ref: true,
                    text: '0/200',
                    style: {
                        height: 20,
                        textAlign: 'right',
                        color: '#999',
                        fontSize: '12px',
                        paddingRight: '10px'
                    }
                },

                del_comment_dialog: {
                    type: 'view',
                    style: {
                        backgroundColor: "#fff",
                        overflow: "hidden",
                        borderRadius: "4px",
                        width: "300px",
                        paddingTop: "60px",
                        paddingBottom: "10px",
                        margin: "auto"
                    },
                    root: ["del_comment_dialog_label", "del_comment_dialog_btn_wrap"]
                },
                del_comment_dialog_label: {
                    type: "text",
                    style: {
                        textAlign: "center",
                        fontSize: "16px",
                        color: "#666666"
                    },
                    text: "确定要删除吗？"
                },
                del_comment_dialog_btn_wrap: {
                    type: "view",
                    style: {
                        marginTop: "50px",
                        textAlign: "center"
                    },
                    root: ["del_comment_dialog_cancelbtn", "del_comment_dialog_okbtn"]
                },
                del_comment_dialog_cancelbtn: {
                    type: 'button',
                    mode: 1,
                    style: {
                        width: "120px",
                        height: "38px",
                        lineHeight: "38px",
                        border: "1px solid #eeeeee",
                        color: "#666666",
                        fontSize: "14px"
                    },
                    title: "取消"
                },
                del_comment_dialog_okbtn: {
                    type: 'button',
                    mode: 2,
                    ref: true,
                    style: {
                        width: "120px",
                        height: "38px",
                        lineHeight: "38px",
                        backgroundColor: "#31d99c",
                        fontSize: "14px",
                        marginLeft: "10px"
                    },
                    title: "确定"
                },
                // comment_attach_list: {
                //   type: 'table',
                //   ref: true,
                //   style: {
                //     background: '#f5f5f5'
                //   },
                //   rowStyle: {
                //     fontSize: '13px',
                //     color: '#333',
                //     borderBottom: '1px solid #eee'
                //   },
                //   columns: [{
                //     headerText: '',
                //     cell: ['row_file_img'],
                //     cellStyle: {
                //       color: '#333',
                //       width: '50px'
                //     }
                //   }, {
                //     headerText: '',
                //     cell: ['row_file_name', 'row_file_delete'],
                //     cellStyle: {
                //       color: '#333',
                //       padding: '10px 0',
                //       position: 'relative'
                //     }
                //   }]
                // },
                row_file_img: {
                    type: 'image',
                    src_bind: 'fileImage',
                    style: {
                        margin: '10px'
                    }
                },
                // row_file_name: {
                //   type: 'text',
                //   text_bind: 'fileName',
                //   marginRight: '40px',
                //   marginLeft: '5px'
                // },
                // row_file_delete: {
                //   type: 'icon',
                //   font: 'icomoon_e902',
                //   style: {
                //     color: '#999',
                //     position: 'absolute',
                //     top: 15,
                //     right: 10,
                //     cursor: 'pointer'
                //   }
                // },
                comment_btn: {
                    type: 'view',
                    root: ['comment_okbtn'],
                    style: {
                        padding: 10,
                        height: 44,
                        background: '#f5f5f5'
                    }
                },

                comment_okbtn: {
                    type: "button",
                    title: "确定",
                    className: 'green-btn',
                    style: {
                        float: 'right'
                    }
                },

                comment_list: {
                    type: "table",
                    ref: true,
                    rowStyle: {
                        fontSize: "13px",
                        color: "#333",
                        borderBottom: "1px solid #eee",
                        transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",
                    },
                    nodata: "comment_nodata",
                    columns: [{
                        headerText: "",
                        cell: ["row_img_status"],
                        cellStyle: {
                            color: "#333",
                            width: "50px",
                            position: "relative"
                        }
                    }, {
                        headerText: "",
                        cell: ["row_name_info", "row_comment_time", "row_comment", "row_comment_attach_list", "row_reply_btn"],
                        cellStyle: {
                            color: "#333",
                            padding: "10px 0",
                            position: "relative"
                        }
                    }]
                },
                row_img_status: {
                    ref: true,
                    style: {
                        display: "inline-block",
                        verticalAlign: "middle",
                        position:"absolute",
                        top:"5px"
                    },
                    type: "statusview",
                    defaultKey: "row_img"
                },
                row_img: {
                    type: "icon",
                    refs: true,
                    src_bind: "avatar",
                    style: {
                        margin: "10px",
                    },
                    imgStyle: {
                        width: "30px",
                        height: "30px",
                        borderRadius: "15px",
                    }
                },
                comment_nodata: {
                    type: "text",
                    text: "暂无评论",
                    style: {
                        fontSize: "14px",
                        color: "#999",
                        width: "100%",
                        textAlign: "center",
                        marginTop: "10px"
                    }
                },
                row_name_info: {
                    type: "view",
                    root: ["row_comment_name", "row_comment_des", "row_reply_name"]
                },
                row_comment_name: {
                    type: "text",
                    text_bind: "name",
                    style: {
                        fontSize: "12px",
                        lineHeight: 1.8,
                        color: "#333",
                        display: "inline-block"
                    }
                },
                row_comment_des: {
                    type: "text",
                    text_bind: "name_des",
                    style: {
                        fontSize: "14px",
                        color: "#999",
                        display: "inline-block",
                        margin: "0px 5px"
                    }
                },
                row_reply_name: {
                    type: "text",
                    text_bind: "rname",
                    style: {
                        fontSize: 12,
                        lineHeight: 1.8,
                        color: "#333",
                        display: "inline-block"
                    }
                },
                row_comment_time: {
                    type: "text",
                    text_bind: "createTime",
                    style: {
                        fontSize: "12px",
                        color: "#999"
                    }
                },
                row_comment: {
                    type: "text",
                    text_bind: "content",
                    style: {
                        fontSize: "12px",
                        color: "#333",
                        wordBreak: 'break-all'
                    }
                },
                row_reply_btn: {
                    type: "button",
                    title_bind: "reply_btn_text",
                    style: {
                        width: "40px",
                        border: 0,
                        position: "absolute",
                        top: "10px",
                        right: 0,
                        color: "#999",
                        fontSize: 12,
                        background: 'transparent'
                    }
                },
                row_comment_attach_list: {
                    type: "repeat",
                    ref: true,
                    items_bind: "replyCommentFileList",
                    style: {
                        background: '#f5f5f5',
                        marginTop: "5px"
                    },
                    root: ["comment_attach_row"]
                },


                // attach_btn: {
                //   type: 'view',
                //   ref: true,
                //   root: ['attach_btn_icon', 'attach_btn_input'],
                //   style: {
                //     position: 'relative',
                //     width: 50,
                //     display: 'none'
                //   }
                // },
                // attach_btn_icon: {
                //   type: 'icon',
                //   font: 'icomoon_e918',
                //   style: {
                //     position: 'absolute',
                //     top: -5,
                //     color: '#999',
                //     fontSize: 20
                //   }
                // },
                // attach_btn_input: {
                //   type: 'input',
                //   mode: 'file',
                //   className: 'comment-input-file'
                // },


                good_wrap: {
                    type: 'view',
                    style: {
                        minHeight: 100,
                        padding: '0 10px',
                        marginBottom: 10
                    },
                    root: ['good_panel']
                },

                good_panel: {
                    type: 'repeat',
                    ref: true,
                    root: ['good_avatar', 'good_name'],
                    className: 'clearfix',
                    itemStyle: {
                        width: 150,
                        height: 50,
                        lineHeight: '30px',
                        padding: '10px 0',
                        marginLeft: 30,
                        float: 'left'
                    },
                    nodata: "good_nodata",
                    style: {
                        border: '1px solid #eee'
                    }
                },

                good_nodata: {
                    type: "text",
                    text: "暂无点赞",
                    style: {
                        fontSize: "14px",
                        color: "#999",
                        width: "100%",
                        textAlign: "center",
                        margin: '20px auto'
                    }
                },

                good_avatar: {
                    type: 'icon',
                    src_bind: 'avatar',
                    style: {
                        width: 30,
                        height: 30,
                        float: 'left',
                        display: 'block',
                    },
                    className: 'good-avatar'
                },

                good_name: {
                    type: 'text',
                    text_bind: 'name',
                    className: 'omit',
                    style: {
                        float: 'left',
                        width: 100,
                        height: 30,
                        lineHeight: '30px',
                        fontSize: 12,
                        marginLeft: 10
                    }
                },

                record_wrap: {
                    type: "view",
                    style: {
                        minHeight: 100,
                        // backgroundColor:"yellow",
                        padding: '0 10px'
                    },
                    root: ['record_panel']
                },

                record_panel: {
                    type: 'repeat',
                    ref: true,
                    root: ['operate_avatar', 'operate_info'],
                    itemStyle: {
                        padding: 10
                    },
                    style: {
                        border: '1px solid #eee',
                        marginBottom: 10
                    },
                    nodata: 'record_nodata',
                },

                record_nodata: {
                    type: "text",
                    text: "暂无记录",
                    style: {
                        fontSize: "14px",
                        color: "#999",
                        width: "100%",
                        textAlign: "center",
                        margin: '20px auto'
                    }
                },

                operate_avatar: {
                    type: 'icon',
                    src_bind: 'avatar',
                    style: {
                        width: 30,
                        height: 30,
                        display: 'block',
                        float: 'left',
                        borderRadius: '100%',
                        overflow: 'hidden'
                    },
                    iconStyle: {
                        width: 30,
                        height: 30,
                    }
                },

                operate_info: {
                    type: 'view',
                    style: {
                        marginLeft: 40,
                        minHeight: 50,
                        padding: '0.1px 0'
                    },
                    root: ['operate_name', 'operate_time', 'operate_des']
                },
                operate_name: {
                    type: 'text',
                    text_bind: 'name',
                    style: {
                        float: 'left',
                        fontSize: 14,
                        lineHeight: 1.8,
                        color: '#333'
                    }
                },

                operate_time: {
                    type: 'text',
                    text_bind: 'time',
                    style: {
                        float: 'right',
                        fontSize: 12,
                        lineHeight: 1.8,
                        color: '#999'
                    }
                },

                operate_des: {
                    type: 'text',
                    text_bind: 'des',
                    style: {
                        lineHeight: 1.4,
                        fontSize: 14,
                        color: '#828282',
                        marginTop: 25
                    }
                },


                segement: {
                    type: "repeat",
                    selectedMode: "s",
                    items: [
                        {"label": "回复"},
                        {"label": "赞"},
                        {"label": "操作记录"}
                    ],
                    style: {
                        overflow: "hidden",
                        fontSize: 14,
                        cursor: "pointer",
                        height: 40,

                        lineHeight: "40px",
                        color: "#666666",
                        padding: '0 20px'
                    },
                    itemStyle: {
                        float: "left",
                        width: "33.33%",
                        height: "100%",
                        textAlign: "center"
                    },
                    root: ["segment_title"]
                },
                segment_title: {
                    text_bind: "label",
                    type: "text",
                    style: {
                        height: "100%"
                    },
                    selectedClassName: "dc-detail-segment-selected"
                },


                range_dialog: {
                    type: "view",
                    style: {
                        width: "429",
                        margin: "auto",
                        backgroundColor: "#fff"
                    },
                    root: ["range_dialog_header", "range_dialog_body"]
                },
                range_dialog_header: {
                    type: "view",
                    style: {
                        backgroundColor: "#f2f3f4",
                        height: "43px",
                        lineHeight: "43px"
                    },
                    root: ["range_dialog_header_title", "range_dialog_header_close"]
                },
                range_dialog_header_title: {
                    type: "text",
                    text: "日志可见范围",
                    style: {
                        fontSize: 13,
                        color: "#666",
                        marginLeft: 20
                    }
                },
                range_dialog_header_close: {
                    type: "icon",
                    font: "icomoon_e90a",
                    style: {
                        color: "#999",
                        cursor: "pointer",
                        position: "absolute",
                        right: 10,
                        top: -3
                    }
                },
                range_dialog_body: {
                    type: "view",
                    style: {
                        height: 423,
                        overflow: "auto",
                        backgroundColor: "#fff"
                    },
                    root: ["rangetree"],
                    className: "range_dialog_body"
                },
                rangetree: {
                    type: "rangetree",
                    className: "rangetree"
                },

                del_dialog: {
                    type: 'view',
                    style: {
                        backgroundColor: "#fff",
                        overflow: "hidden",
                        borderRadius: "4px",
                        width: "300px",
                        height: "165px",
                        paddingTop: "44px",
                        paddingBottom: "10px",
                        margin: "auto"
                    },
                    root: ["del_dialog_label", "del_dialog_btn_wrap"]
                },
                del_dialog_label: {
                    type: "text",
                    style: {
                        textAlign: "center",
                        fontSize: "16px",
                        color: "#666666"
                    },
                    text: "确定要删除吗？"
                },
                del_dialog_btn_wrap: {
                    type: "view",
                    style: {
                        marginTop: "28px",
                        textAlign: "center"
                    },
                    root: ["del_dialog_cancelbtn", "del_dialog_okbtn"]
                },
                del_dialog_cancelbtn: {
                    type: 'button',
                    mode: 1,
                    style: {
                        width: "80px",
                        height: "32px",
                        lineHeight: "32px",
                        border: "1px solid #eeeeee",
                        color: "#666666",
                        fontSize: "14px"
                    },
                    title: "取消"
                },
                del_dialog_okbtn: {
                    type: 'button',
                    mode: 2,
                    ref: true,
                    style: {
                        width: "80px",
                        height: "32px",
                        lineHeight: "32px",
                        backgroundColor: "#1FDA9A",
                        fontSize: "14px",
                        marginLeft: "20px"
                    },
                    title: "确定"
                }

            }
        };
    });
